﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<!----私人订制------>
<link href="/Content/ytcms/css/Custom.css" rel="stylesheet" />
@model YTCMS.Domain.Entities.custom

<div class="jumbotron srdz">
    <div class="content">
        <div class="container">
            <div class="title">
                <div class="msg">
                    <span>
                        您的旅行 您来订制
                    </span>
                </div>
                <div class="margin-top-40">
                    <ol>
                        <li>
                            <div>
                                <img src="/Content/ytcms/img/s2.png" />
                                <span>2分钟收集您的需求</span>
                            </div>
                        </li>
                        <li>
                            <div>
                                <img src="/Content/ytcms/img/s1.png" />
                                <span>4小时内与你电话沟通</span>
                            </div>
                        </li>

                        <li>
                            <div>
                                <img src="/Content/ytcms/img/s3.png" />
                                <span>48小时内获得专属方案</span>
                            </div>
                        </li>
                    </ol>
                </div>
            </div>
            <div class="form margin-top-40">
                <form class="form-inline" id="form" method="post" action="/custom/save" >
                    <div class="form-group">
                        <label>目&nbsp; 的&nbsp;地：</label>
                        @Html.TextBoxFor(s => s.Destination, new { @class = "form-control", placeholder = "目的地", maxlength = "500" })
                        @Html.ValidationMessageFor(s=>s.Destination)
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail2">出发日期：</label>
                        @Html.TextBoxFor(s => s.DepartTime, new { @class = "form-control", placeholder = "出发日期" ,onfocus="WdatePicker({dateFmt: 'yyyy-M-d H:mm:ss' })"  })
                        @Html.ValidationMessageFor(s => s.DepartTime)
                    </div>
                    <div class="form-group">
                        <label>旅行天数：</label>
                        @Html.TextBoxFor(s => s.Day, new { @class = "form-control", placeholder = "旅行天数", maxlength = "4" })
                        @Html.ValidationMessageFor(s => s.Day)
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail2">费用预算：</label>
                        @Html.TextBoxFor(s => s.Money, new { @class = "form-control", placeholder = "费用预算", maxlength = "10" })
                        @Html.ValidationMessageFor(s => s.Money)
                    </div>
                    <div class="form-group">
                        <label>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</label>
                        @Html.TextBoxFor(s => s.Name, new { @class = "form-control", placeholder = "姓名", maxlength = "200" })
                        @Html.ValidationMessageFor(s => s.Name)
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail2">出行人数：</label>
                        @Html.TextBoxFor(s => s.Num, new { @class = "form-control", placeholder = "出行人数", maxlength = "4" })
                        @Html.ValidationMessageFor(s => s.Num)
                    </div>
                    <div class="form-group">
                        <label>联系方式：</label>
                        @Html.TextBoxFor(s => s.Contact, new { @class = "form-control", placeholder = "联系方式", maxlength = "200" })
                        @Html.ValidationMessageFor(s => s.Contact)
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail2">常用邮箱：</label>
                        @Html.TextBoxFor(s => s.Email, new { @class = "form-control", placeholder = "常用邮箱", maxlength = "200" })
                        @Html.ValidationMessageFor(s => s.Email)
                    </div>
                    <div class="form-group w100">
                        <label>旅行群体：</label>
                        @Html.RadioButtonFor(s => s.Object,1, new {@class="form-control"  })
                        家庭度假
                        @Html.RadioButtonFor(s => s.Object, 2, new { @class = "form-control" })
                        蜜月旅行
                        @Html.RadioButtonFor(s => s.Object, 3, new { @class = "form-control" })
                        朋友结伴
                        @Html.RadioButtonFor(s => s.Object, 4, new { @class = "form-control" })
                        团队活动
                    </div>
                    <div class="form-group w100">
                        <label for="exampleInputEmail2">其他要求：</label>
                        @Html.TextAreaFor(s => s.Remark, new { @class = "form-control", rows = "3", maxlength = "500" })
                    </div>
                </form>
                <input type="button" value="告 诉 我 们"  id="btnSave" />
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        $("#btnSave").click(function () {
            if ($("#form").valid())
            {
                $.post("/custom/Save", $("#form").serialize(), function (result) {
                    if (result.d) {
                        jAlert("提交成功", "提示", function () {
                            window.location.href = window.location.href;
                        })
                    }
                    else {
                        jAlert(result.msg, "提示");
                    }
                })
            }
        });
    })
</script>